"""
规格选项管理视图
"""
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from goods.models import SpecificationOption, SPUSpecification
from meiduo_admin.serializers.options_serializers import *
from meiduo_admin.paginations import MyPage

class OptionsView(ModelViewSet):
    """
    规格选项管理
    """
    queryset = SpecificationOption.objects.all()
    serializer_class = OptionModelSerialzier
    pagination_class = MyPage

class OptionSimpleView(ListAPIView):
    """
    新建选项时可选的规格信息
    """
    queryset = SPUSpecification.objects.all()
    serializer_class = OptionSpecificationSerializer